package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 频道相关请求
 * AOP 在不改变原代码的情况下对代码进行增强
 */
@RestController
@RequestMapping("/api/v1/channel")
public class WmChannelController {


    @Autowired
    private WmChannelService wmChannelService;

    @GetMapping("/channels")
    public ResponseResult findAll(){
        //todo 需求：查询所有频道然后返回
        return ResponseResult.okResult(wmChannelService.list());
    }

}
